#pragma once

#include <Ogre.h>
#include "BtOgrePG.h"
#include "BtOgreGP.h"
#include "BtOgreExtras.h"
#include "BaseCannon.h"
#include "BaseLauncher.h"

using namespace Ogre;

class BaseShip
{
public:
	BaseShip(Ogre::String name, Ogre::SceneManager* sceneMgr, Ogre::Vector3 pPos);
	~BaseShip(void);

	void rotateLeft();
	void rotateRight();
	void moveLeft();
	void moveRight();
	void moveUp();
	void moveDown();

	void tickCallBack();
	void updateShip(double timeSinceLastFrame);
	void updateTarget(Ogre::Vector3 target);
	void firePrimaryWeapon();
	void fireSecondaryWeapon();
	void updateCamera(Degree yaw, Degree pitch);
	void changeDebugVisibility();

	Ogre::SceneNode* getCameraNode();
	Ogre::SceneNode* getSightNode();
	btRigidBody					*m_ShipBody;
	Ogre::SceneNode*			m_ShipNode;

private:

	Ogre::Entity*				m_ShipEntity;
	Ogre::Vector3				m_TranslateVector;
	Ogre::Vector3				m_RotateVector;
	Ogre::Real					m_MoveSpeed;
	Ogre::Real					m_RotateSpeed;
	Ogre::Real					m_MaxRotateSpeed;
	float						m_MoveScale;
	float						m_RotScale;

	Ogre::SceneManager*			m_pSceneMgr;

    btCollisionShape			*m_ShipShape;
	BtOgre::RigidBodyState *	shipState;
	int							m_MaxSpeed;

	std::vector<BaseCannon*>	m_Cannons;
	int							m_NumCannons;
	
	int							m_NumLaunchers;
	std::vector<BaseLauncher*>	m_Launchers;

	Ogre::SceneNode*			m_SightNode;
	Ogre::SceneNode*			m_CameraNode;
	Ogre::SceneNode*			m_CameraBaseNode;
};